<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
    $(function(){
        $("#startTime").attr("disabled",'disabled');
     })
    //结账确认
    function acctConfirm(){
        var startTime=$("#startTime").val();
        var endTime=$("#endTime").val();
        if(endTime==null){
            toastr.error("请选择结账结束日期！");
            return false;
        }
         $.ajax({
            type:'post',
            url:'${ctx}/med/medicalCardMaster/confirmCardAcct?startTime='+startTime+"&endTime="+endTime,
            cache:false,
             success:function (data){
                if(data.code=='success'){
                    toastr.success("结账成功");
                    loadDiv('mainCenterDiv','${ctx}/med/medicalCardMaster/cardAcctForm');
                    return ;
                }else{
                    toastr.error("结账失败");
                    return ;
                }
            }
        });
    }
</script>
<div class="app bg-default">
    <section class="layout">
        <div class="content-wrap">
            <div class="row" id="topDivId">
                <div class="col-lg-12">
                    <section class="panel">
                        <div class="panel-body">
                            <form class="form-inline" id="patientInfo" onsubmit="return loadDivForm('acctInfo','patientInfo',timestamp('${ctx}/med/medicalCardMaster/settleDetails'));">
                                <label>日期 ：</label><input  name="startTime" value="${startTime}"  onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="startTime"  class="form-control Wdate"/>&nbsp;
                                至<input name="endTime" value="${endTime}" id="endTime"  class="form-control Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
                                &nbsp;&nbsp;<input  class="btn btn-success" type="submit" value="结账"/>
                                &nbsp;&nbsp;<input  class="btn btn-primary" type="button" value="确认" onclick="acctConfirm();"/>
                            </form>
                        </div>
                    </section>
                </div>
            </div>
            <div class="row" id="settleInfo">
                <section class="panel">
                    <div class="panel-body">
                        <form class="form-inline">
                            <label>充值次数 ：</label><input  id="rcptsNum" name="rcptsNum"  class="form-control" style="width: 100px;"/>&nbsp;
                            <label>充值金额 ：</label><input class="form-control" style="width: 100px;"  id="sumAmount">
                            <label>退卡次数:</label><input   id="refundNum" name="refundNum"    class="form-control"  style="width: 100px;"/>&nbsp;
                            <label>退卡金额 ：</label><input id="chargesAmount" class="form-control" style="width: 100px;" >
                        </form>
                    </div>
                </section>
            </div>
            <div class="row" id="acctInfo">
                <jsp:include page="paymentsSettleBelow.jsp"></jsp:include>
            </div>
        </div>
    </section>
</div>
</div>
</div>